In computer networking, the transport layer is an abstraction layer in a network protocol that provides communication services between applications. Depending on the protocol, these services may include connection-oriented communication, reliable and ordered delivery, flow control, congestion control, and the multiplexing of communication between applications.
The transport layer is defined in both the Internet protocol suite and the OSI model, although the functions assigned to it differ between the two architectures. In the OSI model, the transport layer is Layer 4 ( L4). The layers of the Internet protocol suite are not formally numbered.
The principal transport protocols of the Internet protocol suite are the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP provides a connection-oriented, reliable byte stream service, while UDP provides a connectionless datagram service with fewer protocol mechanisms. Other transport protocols include the Stream Control Transmission Protocol (SCTP) and the Datagram Congestion Control Protocol (DCCP). Newer transport protocols, such as QUIC, may be implemented over UDP.
TCP provides a connection-oriented, reliable, in-order byte-stream service. The application byte stream is carried over the network in TCP segments, each sent as an IP datagram; TCP reliability is based on sequence numbers, checksums, acknowledgments, and retransmission of lost or corrupted segments. TCP also includes flow-control mechanisms based on advertised windows, and TCP endpoints are required to implement basic congestion-control algorithms such as slow start, congestion avoidance, and exponential backoff of retransmission timeouts.
UDP provides a minimal, connectionless, message-oriented transport service. describes UDP as providing a procedure for application programs to send messages with a minimum of protocol mechanism, without guarantees of delivery or duplicate protection; applications that require ordered, reliable streams of data are directed to use TCP instead. similarly describes UDP as a minimal, unreliable, best-effort message-passing transport, and notes that applications using UDP may need to implement additional mechanisms for reliability, congestion control, checksums, or other functions depending on their use case.
UDP is also commonly used for multicast and broadcast applications, but such uses complicate congestion control, flow control, and reliability because a sender may transmit to many receivers over heterogeneous paths. The IETF has defined reliable multicast frameworks and building blocks, so reliability is not impossible for multicast applications; rather, it is not provided by UDP itself and must be supplied by the application or by additional protocols.
The OSI connection-mode transport protocol specification defines five classes of transport protocol, designated class 0 (TP0) through class 4 (TP4). Class 0 provides no error recovery and was designed for use over network services that provide error-free connections, while class 4 includes error recovery and can operate over less reliable network services.
Due to protocol ossification, TCP and UDP have been described as the only widely used transport protocols on the Internet. To avoid middlebox intolerance, new transport protocols may mimic the wire image of a tolerated protocol, or be encapsulated in UDP, accepting some overhead. QUIC follows the latter approach: the QUIC specification defines it as a UDP-based transport protocol whose packets are carried in UDP datagrams, while QUIC itself provides connections, streams, reliable delivery, flow control, and congestion control.
| Packet header size | 8 bytes | 8 bytes | 20–60 bytes | 50–90 bytes | 12 bytes | 12 or 16 bytes | 14+ bytes |
| Typical data-packet overhead | 8 bytes | 8 bytes | 20 bytes | ?? bytes | 44–48+ bytes | 12 or 16 bytes | 14 bytes |
| Transport-layer packet entity | Datagram | Datagram | Segment | Segment | Datagram | Datagram | Datagram |
| Connection-oriented | |||||||
| Reliable transport | |||||||
| Unreliable transport | |||||||
| Preserve message boundary | |||||||
| Delivery | Unordered | Unordered | Ordered | Ordered | Ordered / Unordered | Unordered | Unordered |
| Data checksum | |||||||
| Checksum size | 16 bits | 16 bits | 16 bits | 16 bits | 32 bits | 16 bits | 16 bits |
| Partial checksum | |||||||
| Path MTU | |||||||
| Flow control | |||||||
| Congestion control | |||||||
| Explicit Congestion Notification | |||||||
| Multiple streams | |||||||
| Multi-homing | |||||||
| Bundling / Nagle |
| Connection-oriented network | |||||
| Connectionless network | |||||
| Concatenation and separation | |||||
| Segmentation and reassembly | |||||
| Error recovery | |||||
| Reinitiate connection (if an excessive number of PDUs are unacknowledged) | |||||
| Multiplexing and demultiplexing over a single virtual circuit | |||||
| Explicit flow control | |||||
| Retransmission on timeout | |||||
| Reliable Transport Service |
There is also a connectionless transport protocol, specified by ISO/IEC 8602/ITU-T Recommendation X.234.
|
|